<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>酒店后台管理系统</title>
<jsp:include page="../commonCss.jsp" />
</head>
<body>
	<div class="layui-fluid">
		<div id="select">
			<div class="select_top">
				<div class="select_top_title">
					<span class="layui-breadcrumb" style="visibility:visible;padding: 12px 0 12px 20px;">
		                <a href="" style="font-size:18px;">房间管理</a>
		                <span lay-separator style="font-size:18px;">/</span>
		                <a href="" style="font-size:18px;"><cite>新增房间</cite></a>
	              	</span>
	              	<img style="float:right;margin-right:20px;" src="${pageContext.request.contextPath}/resources/img/icon_refresh.png" title="刷新当前页面"
	              		width="25" height="25"/>
				</div>
			</div>
			<div class="select_nav1">
				<span>新增房间</span>
				<hr>
				<div>
					<form action="${pageContext.request.contextPath}/room/insert" method="post">
						<input type="hidden" name="roomBh" id="room_bh" required="required"></input><br/>
						<label>所属酒店</label>
						<select name="roomName" required="required">
							<option value="选择所属酒店">选择所属酒店</option>
							<option value="如家连锁店">如家连锁店</option>
							<option value="锦江之星">锦江之星</option>
							<option value="速8酒店">速8酒店</option>
							<option value="格林豪泰">格林豪泰</option>
							<option value="南苑E家">南苑E家</option>
							<option value="飘HOME连锁">飘HOME连锁</option>
							<option value="莫泰168">莫泰168</option>
						</select><br/>
						<label>房间类别</label>
						<select name="roomType" required="required">
							<option value="-1">选择类别</option>
							<option value="0">标准间</option>
							<option value="1">双人间</option>
							<option value="2">三人间</option>
						</select><br/>
						<label>房间价格</label>
						<input type="text" name="roomPrice" placeholder="请输入价格" required="required"></input><br/>
						<label>房间楼层</label>
						<input type="text" name="roomFloor" placeholder="请输入楼层" required="required"></input><br/>
						<label>&nbsp;&nbsp;&nbsp;房间号</label>
						<input type="text" name="roomNumber" placeholder="请输入房间号,例如0101" required="required"></input><br/>
						<label>添加时间</label>
						<input type="text" name="roomAddTime" id="room_add_time" required="required" ></input><br/>
						<input type="submit" value="新增" class="btn"></input>
					</form>
				</div>
			</div>
		</div>
	</div>
</body>
<script src="https://layui.11dz.cn/layui-v2.6.8/layui/layui.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery-3.6.0.min.js"></script>
<script type="text/javascript">
	layui.use('layer', function(){
	  var layer = layui.layer;
	  if(<%=request.getSession().getAttribute("username")%> !=null){
		  layer.msg("欢迎来到酒店后台管理系统");
       }else{
     	  alert("请登录");
     	  window.open("${pageContext.request.contextPath}/views/admin/user/login.jsp");
       }
	});
	function datetime() {
		 var now = new Date();
		 var s = now.getSeconds();
		 if(s <= 9){
			 s = "0" + now.getSeconds();
		 }
		 if(now.getMinutes() <= 9){
			 document.getElementById("room_add_time").value = now.getFullYear() + "-"
			 + (now.getMonth() + 1) + "-" + now.getDate();
			 document.getElementById("room_add_time").value += " " + now.getHours() + ":"
			 + "0" + now.getMinutes() + ":" + s;
		 }else{
			 document.getElementById("room_add_time").value = now.getFullYear() + "-"
			 + (now.getMonth() + 1) + "-" + now.getDate();
			 document.getElementById("room_add_time").value += " " + now.getHours() + ":"
			 + now.getMinutes() + ":" + s;
		 }
	}
	window.setInterval("datetime()", 1000);
	window.onload = function(){
		 var now1 = new Date();
		 var s = now1.getSeconds();
		 if(s <= 9){
			 s = "0" + now1.getSeconds();
		 }
		 if(now1.getMinutes() <= 9){
			 document.getElementById("room_bh").value = now1.getFullYear() +  ""
			 + (now1.getMonth() + 1) + "" + now1.getDate()
			 + now1.getHours() + "" + "0" + now1.getMinutes() + "" + s;
		 }else{
			 document.getElementById("room_bh").value = now1.getFullYear() +  ""
			 + (now1.getMonth() + 1) + "" + now1.getDate()
			 + now1.getHours() + "" + now1.getMinutes() + "" + s;
		 }
	}
	$(document).ready(function(){
		$('img').on('click', function() {
			location.reload();
		});
	});
</script>
</html>